﻿using System;
using System.Data.SqlTypes;

namespace CodeContrib
{
	public class RandomSqlDateTime : IRandom<DateTime>
	{
		private readonly RandomDateTime _randomDateTime;

		public RandomSqlDateTime() : this(SqlDateTime.MinValue, SqlDateTime.MaxValue)
		{
		}

		public RandomSqlDateTime(SqlDateTime maxDateTime) : this(SqlDateTime.MinValue, maxDateTime)
		{
		}

		public RandomSqlDateTime(SqlDateTime minDateTime, SqlDateTime maxDateTime)
		{
			_randomDateTime = new RandomDateTime(minDateTime.Value, maxDateTime.Value);
		}

		public DateTime Next()
		{
			return _randomDateTime.Next();
		}
	}
}